﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Collections;
namespace DAO
{
    public class LoaiVeDAO
    {
        public void capNhatThongTin
            (int loaiVe,
            float phiHuyTruocKhoiHanh,
            float phiHuySauKhoiHanh,
            float phiDoiVeTruocKhoiHanh,
            float phiDoiVeSauKhoiHanh,
            float phiNangHangTruocKhoiHanh,
            float phiNangHangSauKhoiHanh,
            float heSo)
        {
            string sql = "update LoaiVe set phiHuyTruocNgayKhoiHanh = " + phiHuyTruocKhoiHanh + ",";
            sql += " phiHuySauNgayKhoiHanh = " + phiHuySauKhoiHanh + ",";
            sql += "phiDoiLichTrinhTruocNgayKhoiHanh  = " + phiDoiVeTruocKhoiHanh + ",";
            sql += " phiDoiLichTrinhSauNgayKhoiHanh = " + phiDoiVeSauKhoiHanh + ",";
            sql += "phiNangHangTruocNgayKhoiHanh  = " + phiNangHangTruocKhoiHanh + ",";
            sql += " phiNangHangSauNgayKhoiHanh = " + phiNangHangSauKhoiHanh + ",";
            sql += "heSoCongDam = " + heSo + "";
            sql += " where ID_loai = "+loaiVe+"";
            DataProvider.ExecuteNoneQuery(sql);
        }
        public DataTable layThamSoHeThong(int loaiVe)
        {
            DataTable dt = new DataTable();
            List<string> dsThamSo = new List<string>();
            ArrayList dsGiaTri = new ArrayList();
            dsThamSo.Add("@loaiVe");

            dsGiaTri.Add(loaiVe);

            dt = DataProvider.ExecuteStoreProc("sp_layThamSoHeThong", dsThamSo, dsGiaTri);
            return dt;
        }
    }
}
